﻿using System.Windows;
using Castle.Core.Logging;
using Inovout.Portal.Desktop.Workbenchs;

namespace Inovout.Portal.Desktop
{
    public class WpfApplicationHost
    {
        public static void Run()
        {
#if DEBUG
            Run(true);
#else
            Run(false);
#endif
        }
        public static void Run(bool isDebug)
        {

            //Assembly.Load("Inovout.Core");
            //Assembly.Load("Inovout.Services");
            //Assembly.Load("Inovout.Business");

            ComponentRegistry.Initialize(isDebug);
            ILogger logger = Logger.Create(typeof(WpfApplicationHost));
            logger.Debug("WpfApplicationHost running...");

            new WpfApplication().Run(ComponentRegistry.Resolve<IMainWorkbench>(WpfApplication.MainWorkbenchKey) as Window);

        }

    }
}
